Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md to fix cosmiconfig reference #200

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

joshmeads
Copy link
Contributor

Fix the cosmiconfig docs

Description

As noted in #192 .lockfile-lint.js is invalid. .lockfile-lintrc.js should be a valid Cosmiconfig with the default setup which you appear to be using.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Related Issue

#192

Motivation and Context

Fixes invalid docs

How Has This Been Tested?

Screenshots (if appropriate):

Checklist:

  • I have updated the documentation (if required).
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I added a picture of a cute animal cause it's fun

Fix the cosmiconfig docs
@joshmeads
Copy link
Contributor Author

Also based on:

cosmiconfigResult = cosmiconfigSync('lockfile-lint').search(searchFrom)

You're simply using the default cosmiconfig loaded which doesn't appear to support toml.

If you like I can add support but I'll update the readme again to remove it for now.

To add support it should be something like this (untested):

import TOML from 'smol-toml';

cosmiconfig('lockfile-lint', {
  loaders: {
    '.toml': TOML.parse
  }
});

https://github.com/cosmiconfig/cosmiconfig#loaders

Anyway great tool, thanks!

@lirantal
Copy link
Owner

@joshmeads sorry for the delay, I'll land this.

I think we can also update the README with adding .lockfile-lintrc which you noted is also supported in the original issue, if I understood correctly.

Also if you wanted to follow-up with TOML support I'm happy to land it.

Thanks friend! ❤️

@lirantal lirantal self-requested a review July 11, 2024 09:32
@lirantal lirantal added the documentation Improvements or additions to documentation label Jul 11, 2024
@lirantal lirantal merged commit 28562ef into lirantal:main Jul 11, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants